Skip to content

Conversation

@aelkiss
Copy link
Member

@aelkiss aelkiss commented Jan 28, 2026

Commenting out the php_value stuff in .htaccess was the main thing that gets the errors out of the web page; ErrorDocument 404 plus the fixes in the PHP default error handler should handle the remaining 404 errors.

To test this:

  • try this branch on dev-N
  • add something that should cause a warning or an error in index.php
  • see that it doesn't show up in the output

With an error, we'll get an unstyled default 500 page. This is better than a messy PHP error; I couldn't get ErrorDocument to work here, and I'm not sure why, but I also don't know how much it really matters. We can certainly keep an eye out to see what kinds of things trigger 500 errors in production.

The fallthrough styled 404 also relies on ErrorDocument in .htaccess, so I don't have a good way to test that with playwright. We could test that e.g. "/foo/bar" gives a styled 404 with playwright, I suppose, if we want, since that's being handled by the application. Again, we can try it on dev-N with a variety of garbage URLs, all of which should give the 404 error page.

@carylwyatt feel free to apply styling as desired in interface/themes/firebird/Error/Error404.tpl (and perhaps Record/error.tpl and Search/error.tpl?)



RewriteRule ^robots.txt$ static/robots.txt [L]
RewriteRule ^F static/rewrite.php [L]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment on the commit - fc3f2a4

@aelkiss aelkiss changed the title ETT-1189: Disable PHP error reporting in production ETT-1189: Disable PHP error reporting in production; ETT-1140 show a styled 404 page Jan 28, 2026
@aelkiss
Copy link
Member Author

aelkiss commented Jan 28, 2026

Playwright indicates that the API paths are returning a 200 when they should return a 404. I'll look at that, and maybe just go ahead and add a playwright test for the default error path in the catalog.

@aelkiss aelkiss marked this pull request as draft January 28, 2026 20:29
@moseshll
Copy link
Contributor

@aelkiss the Bib API 404s in playwright seem to now be squeaking through index.php line 329. If I add header("HTTP/1.0 404 Not Found"); before the exit() then tests pass but it does seem hacquish.

@aelkiss aelkiss marked this pull request as ready for review January 28, 2026 22:20
@moseshll
Copy link
Contributor

Playwright fix: expect(responseBody).toMatch(/Catalog record not found/); playwright/test/slow/deleted_record.spec.js line 33

@moseshll moseshll self-requested a review January 29, 2026 15:51
Copy link
Contributor

@moseshll moseshll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the playwright issue is cleared up I'd call this good to go.

@carylwyatt
Copy link
Member

@moseshll lol were we both working on that playwright issue at the same time? sorry 🙈

@carylwyatt
Copy link
Member

carylwyatt commented Jan 29, 2026

The markup is fine without the styles, but just FYI that the styles for this won't be available until hathitrust/firebird-common#141 is deployed.

aelkiss and others added 4 commits January 29, 2026 13:08
We do not want php error output going to the user.
rewrite.php was removed in 64fd3d4 to
no apparent ill effect. The redirect there to mirlyn-classic won't have
worked for years, and the other rewrite there (with func=direct and a
doc_number parameter) may have served for very obsolete forms of URLs.
This may have been vestigial from when this code base was used for the
Michigan catalog.
* Don't display PHP error messages on the 404 page
* Use as ErrorDocument as well as as the default error handler in
  catalog
@aelkiss aelkiss force-pushed the ETT-1189-no-error-msgs branch from 7aa8371 to e658822 Compare January 29, 2026 18:08
@aelkiss aelkiss merged commit ddf1ece into main Jan 29, 2026
1 of 2 checks passed
@aelkiss aelkiss deleted the ETT-1189-no-error-msgs branch January 29, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants